import request from '@/utils/request'

// 查询仓库配送范围列表
export function listDistribution(query) {
  return request({
    url: '/stock/distribution/list',
    method: 'post',
    data: query
  })
}

// 查询仓库配送范围详细
export function getDistribution(id) {
  return request({
    url: '/stock/distribution/' + id,
    method: 'get'
  })
}

export function getDistrByWarehouseId(id) {
  return request({
    url: '/stock/distribution/getDistrByWarehouseId/' + id,
    method: 'get'
  })
}

// 新增仓库配送范围
export function addDistribution(data) {
  return request({
    url: '/stock/distribution/add',
    method: 'post',
    data: data
  })
}

// 修改仓库配送范围
export function updateDistribution(data) {
  return request({
    url: '/stock/distribution/update',
    method: 'post',
    data: data
  })
}

// 删除仓库配送范围
export function delDistribution(id) {
  return request({
    url: '/stock/distribution/delete/' + id,
    method: 'post'
  })
}
